#include "qcompareresultdialog.h"
#include "ui_qcompareresultdialog.h"

#include "../../libs/core/qbaseitemdelegate.h"

QCompareResultDialog::QCompareResultDialog(const QList<tagComparResult> &list, QWidget *parent):
    QBaseDialog(parent),
    ui(new Ui::QCompareResultDialog)
{
    ui->setupUi(this);

    ui->treeWidget->setItemDelegate(new QBaseItemDelegate);
    ui->treeWidget->setRootIsDecorated(false);
    ui->treeWidget->setAlternatingRowColors(true);

    foreach(const tagComparResult &result,list)
    {
        QTreeWidgetItem *item=new QTreeWidgetItem(ui->treeWidget);
        item->setText(0,result.m_name);
        item->setText(1,result.m_now_value);
        item->setText(2,result.m_compar_value);
    }

    ui->treeWidget->setColumnWidth(0,200);
    ui->treeWidget->setColumnWidth(1,150);
    ui->treeWidget->setColumnWidth(1,150);
}

QCompareResultDialog::~QCompareResultDialog()
{
    delete ui;
}
